<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * HITI AdminCP
 *
 * @package     HITI AdminCP Project
 * @since       Monday, October 21, 2013, 6:00 PM
 * @final       
 * @category    Models
 * @see 		Image load
 * @author      PHUOCNGUYEN - HITI Dev Team
 * @copyright   Copyright (c) 2013, HITI Corp
 */

class Image_load_model extends CI_Model {
	public function __construct()
	{
		parent::__construct();
	}

	public function letter($id)
	{
		$this->db->where('letter', $id);
		$this->db->select('id, emails');
		$query = $this->db->get('newsletter');
		if ($query->num_rows() > 0)
		{
			return $query->row_array();
		}
		else
		{
			return array(
				'id' => '',
				'emails' => ''
			);
		}
	}

	public function process_letter($data, $id)
	{
		if (!is_array($data))
		{
			return false;
		}
		$this->db->where('letter', $id);
		$this->db->update('newsletter', $data);
	}

	public function process_contact($data, $id)
	{
		if (!is_array($data))
		{
			return false;
		}
		$this->db->where('id', $id);
		$this->db->update('contacts', $data);
	}

}

/* End of file Image_load_model.php */
/* Location: ./application/models/Image_load_model.php */